<?php

use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use Dcat\Admin\Admin;

Admin::routes();

Route::group([
    'prefix'     => config('admin.route.prefix'),
    'namespace'  => config('admin.route.namespace'),
    'middleware' => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');
    // 用户
    $router->resource('users', 'UserController');
    // 商品
    $router->resource('products', 'ProductController');
    // 分类
    $router->resource('categories', 'CategoryController');
    $router->get('api/categories', 'CategoryController@apiIndex');
    $router->get('api/categories_children', 'CategoryController@apiChildren');

    // 订单
    $router->resource('orders', 'OrderController');
});
